/*
 * Copyright 2010 Biz-e (info@biz-e.nl)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.site.client;

import java.util.List;

import nl.biz_e.site.shared.models.Content;
import nl.biz_e.site.shared.models.Version;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Asynchrone version of the {@link ContentService} interface
 * 
 * @author Joost A. Bloemsma
 */
public interface ContentServiceAsync {
	/**
	 * @see ContentService#getContent(String)
	 * @param key
	 * @param async
	 */
	public void getContent(String key, AsyncCallback<Content> async);
	
	/**
	 * @see ContentService#getContent(Version)
	 * @param version
	 * @param async
	 */
	public void getContent(Version version, AsyncCallback<Content> async);
	
	/**
	 * @see ContentService#saveContent(Content, String)
	 * @param content
	 * @param key
	 * @param async
	 */
	public void saveContent(Content content, String key, AsyncCallback<Version> async);
	
	/**
	 * @see ContentService#getAvailableKeys()
	 * @param async
	 */
	public void getAvailableKeys(AsyncCallback<List<String>> async);
	
	/**
	 * @see ContentService#getAvailableVersions(String)
	 * @param key
	 * @param async
	 */
	public void getAvailableVersions(String key, AsyncCallback<List<Version>> async);
	
	/**
	 * @see ContentService#getLatestVersion(String)
	 * @param key
	 * @param async
	 */
	public void getLatestVersion(String key, AsyncCallback<Version> async);
	
	/**
	 * @see ContentService#getActiveVersion(String)
	 * @param key
	 * @param async
	 */
	public void getActiveVersion(String key, AsyncCallback<Version> async);
	
	/**
	 * @see ContentService#setActiveVersion(Version)
	 * @param version
	 * @param async
	 */
	public void setActiveVersion(Version version, AsyncCallback<Version> async);
	
	/**
	 * @see ContentService#createKey(String)
	 * @param key
	 * @param async
	 */
	public void createKey(String key, AsyncCallback<Void> async);
	
}
